<!--{include /service/service_head}-->
<!-- End #sidebar -->
	<div id="main-content">
		<!-- Main Content Section with everything -->
		<!-- Page Head -->
		<!-- End .clear -->
		<form action="/service/dataManage.php" id="indexform" method="get">
		<div class="search_box clearfix">
			<select name="shop_id" class="small-input">
				<option value="0">選択してください</option>
				${Utility::Option(Utility::OptionArray($shopList, 'id', 'shop_name'), $defaultShopId)}
			</select>
			<select id="staff_id" name="staff_id" class="small-input">
	           	<option value="0">選択してください</option>
				${Utility::Option(Utility::OptionArray($staffList, 'id', 'family_name', 'personal_name'), $staffId)}
	        </select>
			<input type="submit" name="" value="検索" class="button"/>
		</div>
		</form>
		
		
		<div class="content-box">
			<!-- Start Content Box -->
			<div class="content-box-header">
				<h3>スタッフ別（月勤務統計）</h3>

				<ul class="content-box-tabs">
					<li><a href="#tab1" class="default-tab">详细</a></li>
					<!-- href must be unique and match the id of target div -->
					<li><a href="#tab2">编辑</a></li>
				</ul>
				<div class="clear"></div>
			</div>
			<!-- End .content-box-header -->

			<div class="content-box-content">
				<div class="tab-content default-tab" id="tab1">
					<!-- This is the target div. id must match the href of this div's tab -->
					<div class="table_box">
						<table>
						<thead class="title_head">
							<tr>
								<th class="title">スタッフ</th>

								<th class="title">計算開始時間</th>
								<th class="title">計算終了時間</th>
								<th class="title">トータル出勤時間</th>
								<th class="title">トータル休憩時間</th>
								<th class="title">勤務時間</th>
								<th class="title">時給	</th>

								<th class="title">給料合計</th>
								<th class="title">賞用</th>
								<th class="title">交通費</th>
								<th class="title">立替金</th>
								<th class="title">その他</th>
								<th class="title">罰金</th>

								<th class="title">合計</th>
								<th class="title">印刷</th>
							</tr>
						</thead>
						<tbody>
						
							<!--{loop $salaryMonthList $index1 $one1}-->
						    <tr>
						    	<?php
									$tempStaff = Staff::getById($one1['staff_id'])
    							?>
						    	<td>{$tempStaff['family_name']} {$tempStaff['personal_name']}</td>
						    	<td>${date("Y-m-d", $one1['start_time'])}</td>
						    	<td>${date("Y-m-d", $one1['end_time'])}</td>
						    	<td>{$one1['tuukin_total_hour']}時 {$one1['tuukin_total_minute']}分</td>
						    	<td>{$one1['rest_total_hour']}時 {$one1['rest_total_minute']}分</td>
						    	<td>{$one1['work_total_hour']}時 {$one1['work_total_minute']}分</td>
						    	<td>${number_format($one1['salary'])}</td>
						    	<td>${number_format($one1['back1'])}</td>
						    	<td>${number_format($one1['reword_money'])}</td>
						    	<td>${number_format($one1['bus_money'])}</td>
						    	<td>${number_format($one1['change_money'])}</td>
						    	<td>${number_format($one1['other_money'])}</td>
						    	<td>${number_format($one1['batu_money'])}</td>
						    	<td>${number_format($one1['total_money'])}</td>
						    	<td><a href="/service/dataManage.php?id={$one1['id']}" target="_blank">印刷</a></td>
						    	<!--{if $userAuth[84] != null}-->
						    	<td><a href="/service/dataManage.php?id={$one1['id']}&action=del&shop_id={$defaultShopId}&staff_id={$staffId}"
						   			onclick="return confirm('本当に削除しますか？')"
									style="text-decoration: none;">削除</a></td>
								<!--{/if}-->
						    </tr>
						    <!--{/loop}-->
						    <!--{if $userAuth[83] != null}--> 
							<tr><td><a href="/service/dataManageEdit.php">給料作成</a></td></tr>
						    <!--{/if}-->
						    
							
						</tbody>
					</table>
					</div>

					<div>
					<table>
							<tr>
								<td colspan="7"><div class="pagination"> <a href="#" title="First Page">&laquo; First</a><a href="#" title="Previous Page">&laquo; Previous</a> <a href="#" class="number" title="1">1</a> <a href="#" class="number" title="2">2</a> <a href="#" class="number current" title="3">3</a> <a href="#" class="number" title="4">4</a> <a href="#" title="Next Page">Next &raquo;</a><a href="#" title="Last Page">Last &raquo;</a> </div>

									<!-- End .pagination -->
									<div class="clear"></div></td>
							</tr>
							</table>
					</div>
				</div>
			</div>
			<!-- End .content-box-content -->
		</div>

		<!-- End .content-box -->
		<!-- End .content-box -->
		<!-- End .content-box -->
		<div class="clear"></div>
		<!-- Start Notifications -->
		<!-- End Notifications -->
		<div id="footer"> <small>
			<!-- Remove this notice or replace it with whatever you want -->

			&#169; Copyright 2011 川崎エステ　エレガントリゾート　すべての女性を美しく幸せに | Powered by <a href="#">ZHONGHUA</a> | <a href="#">Top</a> </small> </div>
		<!-- End #footer -->
	</div>
	<!-- End #main-content -->
</div>

</body>
<!-- Download From www.exet.tk-->
</html>


<script type="text/javascript"> 
	var tempCalendar = null;
	jQuery(function(){
		if( $("input[name='start_date']").length > 0 ){
			tempCalendar = new Calendar(new Date().getFullYear(), 2020, 2,'yyyy-MM-dd');
			document.onclick = function(){
				//alert( 'using   js   2 ');
				tempCalendar.hide();
			}
			$("input[name='start_date']").bind("click", function(e){
				tempCalendar.show(this);
				document.getElementById('calendarPanel').style.width='160px';
				e.stopPropagation();
				e.preventDefault();
			});
			$("input[name='start_date']").bind("focus", function(e){
				tempCalendar.show(this);
				document.getElementById('calendarPanel').style.width='160px';
				e.stopPropagation();
				e.preventDefault();
			});

			$("input[name='end_date']").bind("click", function(e){
				tempCalendar.show(this);
				document.getElementById('calendarPanel').style.width='160px';
				e.stopPropagation();
				e.preventDefault();
			});
			$("input[name='end_date']").bind("focus", function(e){
				tempCalendar.show(this);
				document.getElementById('calendarPanel').style.width='160px';
				e.stopPropagation();
				e.preventDefault();
			});
	
			$("#calendarPanel").bind("click", function(e){
				e.stopPropagation();
				e.preventDefault();
			});
		}
	});

	jQuery(function(){
		$("select[name='shop_id']").bind("change", function(){
			if( $(this).val() < 1 ){
				return ;
			}
			$.get("{$webRoot}/service/searchStaff.php", "shop_id=" + $(this).val(), function(data){
				
				var options = '<option value="0">選択してください</option>';
				if( data.error == 0 ){
					for(var index in data.data){
						if( !index ){
							continue;
						}
						options = options + '<option value="' + data.data[index].id + '">' + data.data[index].family_name + " " + data.data[index].personal_name + '</option>';
						
					}
				}
				$("#staff_id").html(options);
			}, "json");
			
		});
	});
</script> 
</html> 